Carbon


FSpRename

Header: Files.h Carbon status: Supported

Renames a file or directory.

OSErr FSpRename (
    const FSSpec *spec, 
    ConstStr255Param newName
);
Parameter descriptions
spec

A pointer to an FSSpec structure specifying the file or directory to rename.

newName

The new name of the file or directory.

function result

A result code.

DISCUSSION

If a file ID reference for the specified file exists, it remains with the renamed file.

If you want to change the name of a new copy of an existing file, you should use the FSpExchangeFiles function instead.

AVAILABILITY

Supported in Carbon. Available in Carbon 1.0.2 and later when running Mac OS 8.1 or later.


© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)